package com.new2i.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
 
import com.new2i.dao.able.DoctorUserDao;
import com.new2i.dao.mapper.DoctorUserMapper;
import com.new2i.model.DoctorUserEntity;
import com.new2i.util.ConstantUtil;

/**
 * 医生管理用户的
 * 
 * @since 2015/09/03
 * @author 2i
 *
 */
@Repository("DoctorUserDao")
public class DoctorUserDaoImpl implements DoctorUserDao{

	@Autowired
	private DoctorUserMapper doctorUserMapper;
	
	@Override
	public List<HashMap<String, Object>> selectUserList(int doctor_id,String keyword,int du_group_id,int page) {  
		return doctorUserMapper.selectUserList(doctor_id, keyword, du_group_id,
				(page - 1) * ConstantUtil.COUNT_PER_PAGE, ConstantUtil.COUNT_PER_PAGE);
	}

	@Override
	public HashMap<String, Object> getUserCount(int doctor_id, String keyword, int du_group_id) { 
		return doctorUserMapper.getUserCount(doctor_id, keyword, du_group_id);
	}
	

	@Override
	public HashMap<String, Object> getTotalUserCount(int doctor_id) { 
		return doctorUserMapper.getTotalUserCount(doctor_id);
	}

	@Override
	public DoctorUserEntity insertDoctorUser(DoctorUserEntity doctorUser) { 
		 doctorUserMapper.insertDoctorUser(doctorUser);
		 return doctorUser;
	}

	@Override
	public List<HashMap<String, Object>> selectByDoctorUserId(int doctor_id, int user_id) {
		return doctorUserMapper.selectByDoctorUserId(doctor_id, user_id);
	}

	@Override
	public int updateUserStatusByDU(int doctor_id, int user_id, int user_status) {
		return doctorUserMapper.updateUserStatusByDU(doctor_id, user_id, user_status);
	} 

}
